#include "ResImage.h"

ResImage::ResImage(std::string filename, int columns, int rows)
: columns(columns)
, rows(rows)
, fileName(filename)
{    
    LoadFromFile(filename);
    SetSmooth(true);
    frameWidth = columns != 0 ? GetWidth() / columns : GetWidth();
    frameHeight = rows != 0 ? GetHeight() / rows : GetHeight();
}

int ResImage::getColumns() const
{
    return columns;
}

void ResImage::setColumns( int columns )
{
    columns = columns;
}

int ResImage::getRows() const
{
    return rows;
}

void ResImage::setRows( int rows )
{
    rows = rows;
}

int ResImage::getFrameWidth() const
{
    return frameWidth;
}

void ResImage::setFrameWidth( int frameWidth )
{
    frameWidth = frameWidth;
}

int ResImage::getFrameHeight() const
{
    return frameHeight;
}

void ResImage::setFrameHeight( int frameHeight )
{
    frameHeight = frameHeight;
}

std::string ResImage::getFileName() const
{
    return fileName;
}
